package hu.myai.controller;

import hu.myai.runtimeneural.InitNeuralNetwork;
import hu.myai.util.SanfordNet;

import java.util.ArrayList;
import java.util.List;

import org.joone.log.ILogger;
import org.joone.log.LoggerFactory;

public class InitNetwork {

	private static final ILogger log = LoggerFactory.getLogger(InitNetwork.class);

	public InitNetwork() {
		super();
	}

	public void go(String symbol) {

		// if not even one given over, it makes it all
		List<String> symbolList = new ArrayList<String>();
		if ("".equals(symbol)) {
			SanfordNet netUtil = new SanfordNet();
			symbolList = netUtil.getAllSymbol();
		} else
			symbolList.add(symbol);

		InitNetwork thisClass = new InitNetwork();

		InitNet sampleNet = thisClass.new InitNet();

		for (String symbolItem : symbolList) {
			log.info("Init symbol: " + symbolItem);
			sampleNet.go(symbolItem, 400, 400, 400);
			sampleNet.nnet.join();
			log.info("Init done: " + symbolItem);
		}
	}

	public void go() {
		go("");
	}

	public class InitNet extends InitNeuralNetwork {
		public InitNet() {
		}
	}

}
